package com.sihan.swvp.service.sys;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.sihan.swvp.dao.sys.PrivEnterpriseDao;
import com.sihan.swvp.entity.sys.User;

@Component
public class PrivEnterpriseService {
	@Autowired
	PrivEnterpriseDao privEnterpriseDao;
	
	public List<Map<String, Object>> getPri(int e){
		
		return privEnterpriseDao.getPri(e);
	}
	
	@Transactional
	public void addPri(int e,int pries){
		privEnterpriseDao.addPri(e, pries);
	}

//	public void deletePri(int e, int prie) {
//		// TODO Auto-generated method stub
//		privEnterpriseDao.deletePri(e, prie);
//	}

	public List<Map<String, Object>> getEnterprise(User user) {
		// TODO Auto-generated method stub
		return privEnterpriseDao.getEnterprise(user.getDept(), user.getId());
	}

	public void deleteAllPriv(int e) {
		// TODO Auto-generated method stub
		privEnterpriseDao.deletePriByE(e);
	}

//	public void addPriv(Map<String, Object> params) {
//		// TODO Auto-generated method stub
//		privEnterpriseDao.addPriv(params);
//	}

	public void addPrivs(int e, String[] idsarray) {
		// TODO Auto-generated method stub
		privEnterpriseDao.addPrivs(e,idsarray);
	}
}
